package com.itheima.controller;

import com.itheima.domain.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class test1 {

    @Autowired
    private Person person;

    @Value("${person.name}")
    private String name;


    @RequestMapping("/hello")
    public String hello(){
        System.out.println(person.getAge());
        System.out.println(person.getName());
        String[] hobby = person.getHobby();
        for (String s : hobby) {
            System.out.println(s);
        }
        return " hello Spring Boot !"+name;

    }
}
